package com.gl.codewar.template;

public class DivideBy11 {

	public static boolean isDivideBy11(long i) {
	
            if (i <= 0) {
                return false;
            }
            
            if( i < 100 ) {
                return i % 11 == 0;
            }
            
            String number = Long.toString(i);
            do{
                long u = Long.valueOf(number.substring(number.length() - 1, number.length()));
                number = number.substring(0, number.length() - 1);
                number = Long.toString(Long.valueOf(number) - u);
           
                
            } while(number.length() > 2);
            
            return Long.valueOf(number) % 11 == 0;
	}
 }
